/**
 */
package fUML.Semantics.Classes.Kernel.impl;

import fUML.Semantics.Classes.Kernel.Evaluation;
import fUML.Semantics.Classes.Kernel.KernelPackage;
import fUML.Semantics.Classes.Kernel.Value;

import fUML.Semantics.Loci.LociL1.Locus;

import fUML.Semantics.Loci.LociL1.impl.SemanticVisitorImpl;

import fUML.Syntax.Classes.Kernel.ValueSpecification;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Evaluation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fUML.Semantics.Classes.Kernel.impl.EvaluationImpl#getSpecification <em>Specification</em>}</li>
 *   <li>{@link fUML.Semantics.Classes.Kernel.impl.EvaluationImpl#getLocus <em>Locus</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class EvaluationImpl extends SemanticVisitorImpl implements Evaluation {
	/**
	 * The cached value of the '{@link #getSpecification() <em>Specification</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSpecification()
	 * @generated
	 * @ordered
	 */
	protected ValueSpecification specification;

	/**
	 * The cached value of the '{@link #getLocus() <em>Locus</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLocus()
	 * @generated
	 * @ordered
	 */
	protected Locus locus;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EvaluationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return KernelPackage.Literals.EVALUATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ValueSpecification getSpecification() {
		if (specification != null && specification.eIsProxy()) {
			InternalEObject oldSpecification = (InternalEObject)specification;
			specification = (ValueSpecification)eResolveProxy(oldSpecification);
			if (specification != oldSpecification) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, KernelPackage.EVALUATION__SPECIFICATION, oldSpecification, specification));
			}
		}
		return specification;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ValueSpecification basicGetSpecification() {
		return specification;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSpecification(ValueSpecification newSpecification) {
		ValueSpecification oldSpecification = specification;
		specification = newSpecification;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, KernelPackage.EVALUATION__SPECIFICATION, oldSpecification, specification));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Locus getLocus() {
		if (locus != null && locus.eIsProxy()) {
			InternalEObject oldLocus = (InternalEObject)locus;
			locus = (Locus)eResolveProxy(oldLocus);
			if (locus != oldLocus) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, KernelPackage.EVALUATION__LOCUS, oldLocus, locus));
			}
		}
		return locus;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Locus basicGetLocus() {
		return locus;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLocus(Locus newLocus) {
		Locus oldLocus = locus;
		locus = newLocus;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, KernelPackage.EVALUATION__LOCUS, oldLocus, locus));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Value evaluate() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case KernelPackage.EVALUATION__SPECIFICATION:
				if (resolve) return getSpecification();
				return basicGetSpecification();
			case KernelPackage.EVALUATION__LOCUS:
				if (resolve) return getLocus();
				return basicGetLocus();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case KernelPackage.EVALUATION__SPECIFICATION:
				setSpecification((ValueSpecification)newValue);
				return;
			case KernelPackage.EVALUATION__LOCUS:
				setLocus((Locus)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case KernelPackage.EVALUATION__SPECIFICATION:
				setSpecification((ValueSpecification)null);
				return;
			case KernelPackage.EVALUATION__LOCUS:
				setLocus((Locus)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case KernelPackage.EVALUATION__SPECIFICATION:
				return specification != null;
			case KernelPackage.EVALUATION__LOCUS:
				return locus != null;
		}
		return super.eIsSet(featureID);
	}

} //EvaluationImpl
